<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>Медиабаза</title>

        <!-- jQuery and jQuery UI (REQUIRED) -->
        <link rel="stylesheet" type="text/css" media="screen" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/smoothness/jquery-ui.css">
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"></script>

        <!-- elFinder CSS (REQUIRED) -->
        <link rel="stylesheet" type="text/css" media="screen" href="/js/elfinder-2.0-rc1/css/elfinder.min.css">
        <link rel="stylesheet" type="text/css" media="screen" href="/js/elfinder-2.0-rc1/css/theme.css">

        <!-- elFinder JS (REQUIRED) -->
        <script type="text/javascript" src="/js/elfinder-2.0-rc1/js/elfinder.min.js"></script>

        <!-- elFinder translation (OPTIONAL) -->
        <script type="text/javascript" src="/js/elfinder-2.0-rc1/js/i18n/elfinder.ru.js"></script>

        <!-- elFinder initialization (REQUIRED) -->
        <script type="text/javascript" charset="utf-8">
            $().ready(function() {
                $('#elfinder').elfinder({
                    url : '/js/elfinder-2.0-rc1/php/connector.php',
                    lang: 'ru',
                    width: 'auto',
                    height: '460',
                    ui: ['toolbar'],
                    {% if mime == 'image' %}onlyMimes: ["image"],
                    {% elseif mime == 'flash' %}onlyMimes: ["application/x-shockwave-flash"],{% endif %}
                    
                    uiOptions : {
                        toolbar : [
                            // ['back', 'forward'],
                            ['reload'],
                            // ['home', 'up'],
                            ['mkdir', /*'mkfile',*/ 'upload'],
                            ['open', 'download', 'getfile'],
                            // ['info'],
                            ['quicklook'],
                            // ['copy', 'cut', 'paste'],
                            ['rm'],
                            // ['duplicate', 'rename', 'edit', 'resize'],
                            // ['extract', 'archive'],
                            ['search'],
                            ['view'],
                            // ['help']
                        ]
                    },
                    commandsOptions : {
                        // configure value for "getFileCallback" used for editor integration
                        getfile : {
                            // send only URL or URL+path if false
                            onlyURL  : true,

                            // allow to return multiple files info
                            multiple : false,

                            // allow to return folders info
                            folders  : false,

                            // action after callback (close/destroy)
                            oncomplete : ''
                        }
                    },
                    getFileCallback: function(f) {
                        if (window.opener && !window.opener.closed && window.opener.getFileCallback) {
                            window.opener.getFileCallback(f)
                        }
                        window.close()
                    }                    
                }).elfinder('instance')
            })
        </script>
    </head>
    <body>

        <!-- Element where elFinder will be created (REQUIRED) -->
        <div id="elfinder"></div>

    </body>
</html>
